#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QInputDialog>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    int res = QInputDialog::getInt(this, "整形对话框", "输入整数：");
    qDebug() << res;
}

void MainWindow::on_pushButton_2_clicked()
{
    double res = QInputDialog::getDouble(this, "浮点对话框", "输入小数：");
    qDebug() << res;
}

void MainWindow::on_pushButton_3_clicked()
{
    QStringList list;
    list.push_back("111");
    list.push_back("222");
    QString res = QInputDialog::getItem(this, "条目对话框", "输入条目", list);
    qDebug() << res;
}
